﻿<div>
    <AutoComplete @ref="@_autoComplete" OnChange="OnChange" @bind-Value="@value"></AutoComplete>
</div>
<br />
<span>bind-Value:@value</span>

@code
{
    private AutoComplete _autoComplete;

    private string value;

    private void OnChange(string value)
    {
        if (string.IsNullOrWhiteSpace(value))
        {
            _autoComplete.LoadData(null);
            return;
        }

        var list = new List<string>()
        {
            value, value + value, value + value + value
        };
        _autoComplete.LoadData(list);
    }
}